package com.dc.wifi.main.ui.fragment

import android.os.Bundle
import com.dc.netlib.base.BaseFragment
import com.dc.wifi.BR
import com.dc.wifi.R
import com.dc.wifi.databinding.FragmentMineBinding
import com.dc.wifi.main.Commons.Constant
import com.dc.wifi.main.model.MineViewModel
import com.qmuiteam.qmui.skin.QMUISkinManager

class MineFragment:BaseFragment<MineViewModel,FragmentMineBinding>(R.layout.fragment_mine, BR.mMineViewModel){
    companion object {
        fun createFragment(bundle: Bundle = Bundle()): MineFragment {
            return MineFragment().apply {
                arguments = bundle
            }
        }
    }

    override fun initView(savedInstanceState: Bundle?) {
        super.initView(savedInstanceState)
        binding.switchSkin.setOnCheckedChangeListener { _, isChecked ->
            if (isChecked) {

                QMUISkinManager.defaultInstance(context).changeSkin(Constant.SKIN_1)

            } else {
                QMUISkinManager.defaultInstance(context).changeSkin(Constant.SKIN_2)

            }
        }
    }
}